<div class="al-modal-view">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" ng-click="cancel()">
      <span aria-hidden="true" class="glyphicon glyphicon-remove"></span>
      <span class="sr-only">Close</span>
    </button>
    <h4 class="modal-title ok-color">{{modalTitle}}</h4>
  </div>
  <div class="modal-body">
    <ng-form name="modalForm" class="form-horizontal form-validation" role="form">
      <div class="form-group">
        <label class="col-sm-3 control-label">规则名称<span class="attr-need">*</span></label>
        <div class="col-sm-9">
          <input class="form-control" type="text" placeholder="规则名称"  required
                 ng-readonly="type!='new'"
                 ng-model="data.ruleName">
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">规则描述</label>
        <div class="col-sm-9">
          <textarea cols="5" class="form-control"
                    ng-readonly="type!='new'"
                    ng-model="data.description"></textarea>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">适用城市</label>
        <div class="col-sm-9">
          <select ng-model="data.city" class="form-control" ng-change="loadCityApart()"
                  ng-disabled="type!='new'"
                  ng-options="option.value as option.name for option in cityList"></select>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">适用门店</label>
        <div class="col-sm-9">
          <select ng-model="data.storeId" class="form-control"
                  ng-disabled="type!='new'"
                  ng-options="option.id as option.name for option in modalApartmentList"></select>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">适用渠道</label>
        <div class="col-sm-9">
          <div ng-if="type!='new'" class="form-control info-text">
            {{data.channel|binConstantTransfer:modalChannelList}}</div>
          <bin-list-checkbox ng-if="type=='new'" bin-value="data.channel"
                             bin-list="modalChannelList"></bin-list-checkbox>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">适用付款方式</label>
        <div class="col-sm-9">
          <div ng-if="type!='new'" class="form-control info-text">
            {{data.payWay|binConstantTransfer:modalPayWayList}}</div>
          <bin-list-checkbox ng-if="type=='new'"
                             bin-value="data.payWay" bin-list="modalPayWayList"></bin-list-checkbox>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">适用租期</label>
        <div class="col-sm-9">
          <div ng-if="type!='new'" class="form-control info-text">
            {{data.lease|binConstantTransfer:modalLeaseBinList}}</div>
          <bin-list-checkbox ng-if="type=='new'"  bin-value="data.lease"
                             bin-list="modalLeaseBinList"></bin-list-checkbox>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">结算方式</label>
        <div class="col-sm-9">
          <select ng-model="data.settleWay" class="form-control"
                  ng-disabled="type!='new'"
                  ng-options="option.value as option.name for option in modalSettleWayList"></select>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label" ng-if="data.ruleType!=3">优惠金额/百分比<span class="attr-need">*</span></label>
        <label class="col-sm-3 control-label" ng-if="data.ruleType==3">优惠金额<span class="attr-need">*</span></label>
        <div class="col-sm-9">
          <input type="number" ng-model="data.money" ng-readonly="type!='new'"
                 class="form-control" required>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">开始时间<span class="attr-need">*</span></label>
        <div class="col-sm-9">
          <div class="input-group">
            <input class="form-control" type="text" uib-datepicker-popup="yyyy-MM-dd"
                   ng-model="data.startTime" is-open="enterStart" maxlength="10"
                   ng-readonly="type!='new'"
                   close-text="关闭" current-text="今天" clear-text="清空" required
                   placeholder=""/>
            <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-disabled="type!='new'"
                        ng-click="enterStart=true">
                  <i class="glyphicon glyphicon-calendar"></i>
                </button>
              </span>
          </div>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">结束时间<span class="attr-need">*</span></label>
        <div class="col-sm-9">
          <div class="input-group">
            <input class="form-control" type="text" uib-datepicker-popup="yyyy-MM-dd"
                   ng-model="data.endTime" is-open="enterEnd" maxlength="10"
                   ng-readonly="type!='new'"
                   close-text="关闭" current-text="今天" clear-text="清空" required
                   placeholder=""/>
            <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-disabled="type!='new'"
                        ng-click="enterEnd=true">
                  <i class="glyphicon glyphicon-calendar"></i>
                </button>
              </span>
          </div>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">状态</label>
        <div class="col-sm-8">
          <nobr>
            <label class="ui-radio" ng-repeat="option in modalStatusList">
              <input name="status" ng-value="option.value" type="radio" ng-model="data.status">
              <span>{{option.name}}</span>
            </label>
          </nobr>
        </div>
      </div>
    </ng-form>
  </div>
  <div class="modal-footer">
    <button class="btn btn-warning no-border" type="button" ng-click="cancel()">返回</button>
    <button class="btn btn-primary no-border" type="button" data-ng-disabled="modalForm.$invalid" ng-click="confirm()">确认</button>
  </div>
</div>